<div class="toggle__switch-trigger float-right">
  <% label = "publish_response_#{question.id}" %>
  <label for="<%= label %>" class="toggle__switch-toggle">
    <span class="toggle__switch-trigger-text">
      <%= content_tag(:span, class: "label success ml-[-8.5rem] mt-1 #{"hidden" if question.survey_responses_published_at.blank?}") { t("status.published", scope: "decidim.surveys.admin.publish_responses.index") } %>
      <%= content_tag(:span, class: "label alert -ml-40 mt-1 #{"hidden" if question.survey_responses_published_at.present?}") { t("status.not_published", scope: "decidim.surveys.admin.publish_responses.index") } %>
    </span>
    <span>
      <input
      <%== %(checked="checked") if question.survey_responses_published_at.present? %>
      id="<%= label %>"
      type="checkbox"
      name="<%= label %>"
      data-publish-question-response-action="<%= question.survey_responses_published_at.present? ? "unpublish" : "publish" %>"
      data-publish-question-response-question-url="<%= survey_publish_response_path(params[:survey_id], question) %>">
      <span class="toggle__switch-toggle-content">
      </span>
      <%= icon "check-line", class: "toggle__switch-toggle-icon" %>
      <%= icon "close-line", class: "toggle__switch-toggle-icon" %>
    </span>
  </label>
</div>
